package com.itheima.mapper;

import com.itheima.pojo.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface MemberMapper {

    @Select("select * from t_member where name = #{name} and idCard = #{idCard}")
    List<Member> getMemberByNameandIdCard(String name, String idCard);

    /**
     * 添加新会员
     *
     * @param member
     * @param date
     */
    void addMember(Member member, LocalDate date);

    /**
     * 根据手机号查询会员
     * @param telephone
     * @return
     */
    @Select("select * from t_member where phoneNumber = #{telephone}")
    List<Member> getMemberByTelephone(String telephone);
}
